<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>login</title>
    <link rel="shortcut icon" href="#"/>
</head>
<body>
    <form id="loginForm">
        账 &nbsp; 户:<input type="text" name="username" id="username"><br/>
        密 &nbsp; 码:<input type="password" name="password" id="password"><br/>
       <!-- 验证码:<input type="text" name="verificationCode" id="verificationCode" onblur="checkCode()" >
        <span id="codeText"></span><br/>
        <img src="/validateCode" alt="验证码" id="codePicture">
        <a href="#" style="text-decoration: none;color: #5494F3" id="refreshCode">看不清楚?换一张</a><br/>-->
        <button id="sub" type="button">登录</button>
    </form>

    <script src="js/jquery-3.6.0.min.js"></script>
    <script type="text/javascript">

        $("#sub").click(function () {
            //获取表单数据
            var data = $("#loginForm").serialize();
            $.post("/person?method=login",data,function (result) {
                alert(result);
                if (result == "success"){
                    // location.href = "/personList.html";
                    Location.href = "/showList.html";
                }else {
                    alert("用户名或密码错误")
                }
            });
        });
    </script>
</body>
</html>